package towerDefense;

import java.awt.Dimension;
import java.io.File;
import towerDefense.screens.ElementSelectScreen;
import towerDefense.screens.LevelSelectScreen;
import towerDefense.screens.MainMenu;
import towerDefense.screens.PlayScreen;
import com.golden.gamedev.GameEngine;
import com.golden.gamedev.GameLoader;
import com.golden.gamedev.GameObject;


public class TowerDefense extends GameEngine
{

    /////////////////ADJUST THIS TO CHANGE RESOLUTION!!!
    public static final Dimension DEFAULT_DIM = new Dimension(1920, 1080);
    ///////////////////DO NOT TOUCH ANYTHING ELSE :))

    public static final int MAIN_MENU = 0, ELEMENT_SELECT_MENU = 1,
            LEVEL_SELECT_MENU = 2, PLAY_SCREEN = 3;
    public boolean isNewGame = true;
    public static int ELEMENT_TYPE;
    public static final int EARTH_ID = 0, FIRE_ID = 1, WATER_ID = 2,
            WIND_ID = 3;
    public static final File MAIN_MENU_IMAGE = new File("src/images/menu/main/mainmenu.jpg"),
            TITLE_IMAGE = new File("src/images/menu/main/title.png"),
            FIRE_IMAGE = new File("images/menu/elements/fire.jpg"),
            WATER_IMAGE = new File("images/menu/elements/water.jpg"),
            WIND_IMAGE = new File("images/menu/elements/wind.jpg"),
            EARTH_IMAGE = new File("images/menu/elements/earth.jpg");


    @Override
    public void initResources ()
    {
        nextGameID = MAIN_MENU;
//        nextGameID = ELEMENT_MENU;
//        nextGameID = PLAY_SCREEN;
    }


    @Override
    public GameObject getGame (int GameID)
    {
        switch (GameID)
        {
            case MAIN_MENU: // GameID = 0 is always the first to play
                return new MainMenu(this, MAIN_MENU_IMAGE, TITLE_IMAGE);
            case ELEMENT_SELECT_MENU:
                return new ElementSelectScreen(this);
            case LEVEL_SELECT_MENU:
                return new LevelSelectScreen(this);
            case PLAY_SCREEN:
                return new PlayScreen(this);
        }

        return null;
    }


//////////////////////////////////////////////////////////////////
//////////////////////////GAME START /////////////////////////////
//////////////////////////////////////////////////////////////////

    public static void main (String[] args)
    {
        ELEMENT_TYPE = EARTH_ID;
        GameLoader game = new GameLoader();
        game.setup(new TowerDefense(), DEFAULT_DIM, true);
        game.start();
    }

}
